package net.gyapp.markim.core.entity;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;

import java.io.Serializable;
import org.greenrobot.greendao.annotation.Generated;

/**
 * Auther:  winds
 * Email:   heardown@163.com
 * Date:    2018/7/19.
 * Desc:    消息
 */
@Entity
public class MessageEntity implements IEntity, Serializable {
    private static final long serialVersionUID = 8729519513838533327L;
    @Id(autoincrement = true)
    public Long id;

    public Long conversationId;  //会话id
    public Long userId;

    public int chatType;          //聊天类型   群聊  私聊
    public int cmd;                //命令码
    public String content;         //消息体
    public Long createTime;       //发送时间
    public String group_id;        //群聊消息 群id
    public String messageId;       //消息id  在收到消息时返回
    public int msgType;             //消息类型

    public String from;             //发送人id
    public String fromAvatar;      //发送人头像
    public String fromName;         //发送人名称
    public String fromNick;         //发送人昵称
    public String fromRemark;       //发送人备注


    public String to;
    public String toAvatar;
    public String toName;
    public String toNick;
    public String toRemark;

    public int isRead;   // 消息是否已读 0 未读  1 已读
    public int isVoiceRead; //语音消息是否已读   仅在接收非自己语音消息的情况下
    public String voiceLocalPath;  //语音消息本地路径   自己发送的情况下 主动保存  接收的情况下 考虑保存


    public int isOwnSend; //是否是自己发送 0 不是  1 是
    public int isFailed;   //是否失败  仅在自己发送的情况下  0 成功  1 失败

    public int isSending; //是否处于发送状态  用于图片 语音发送前显示提醒

    public String extra1;  //扩展字段1
    public String extra2;  //扩展字段2
    public String extra3;  //扩展字段3


    @Generated(hash = 1128697868)
    public MessageEntity(Long id, Long conversationId, Long userId, int chatType,
            int cmd, String content, Long createTime, String group_id,
            String messageId, int msgType, String from, String fromAvatar,
            String fromName, String fromNick, String fromRemark, String to,
            String toAvatar, String toName, String toNick, String toRemark,
            int isRead, int isVoiceRead, String voiceLocalPath, int isOwnSend,
            int isFailed, int isSending, String extra1, String extra2,
            String extra3) {
        this.id = id;
        this.conversationId = conversationId;
        this.userId = userId;
        this.chatType = chatType;
        this.cmd = cmd;
        this.content = content;
        this.createTime = createTime;
        this.group_id = group_id;
        this.messageId = messageId;
        this.msgType = msgType;
        this.from = from;
        this.fromAvatar = fromAvatar;
        this.fromName = fromName;
        this.fromNick = fromNick;
        this.fromRemark = fromRemark;
        this.to = to;
        this.toAvatar = toAvatar;
        this.toName = toName;
        this.toNick = toNick;
        this.toRemark = toRemark;
        this.isRead = isRead;
        this.isVoiceRead = isVoiceRead;
        this.voiceLocalPath = voiceLocalPath;
        this.isOwnSend = isOwnSend;
        this.isFailed = isFailed;
        this.isSending = isSending;
        this.extra1 = extra1;
        this.extra2 = extra2;
        this.extra3 = extra3;
    }


    @Generated(hash = 1797882234)
    public MessageEntity() {
    }


    @Override
    public String toString() {
        return "MessageEntity{" +
                "id=" + id +
                ", conversationId=" + conversationId +
                ", userId=" + userId +
                ", chatType=" + chatType +
                ", cmd=" + cmd +
                ", content='" + content + '\'' +
                ", createTime=" + createTime +
                ", group_id='" + group_id + '\'' +
                ", messageId='" + messageId + '\'' +
                ", msgType=" + msgType +
                ", from='" + from + '\'' +
                ", fromAvatar='" + fromAvatar + '\'' +
                ", fromName='" + fromName + '\'' +
                ", fromNick='" + fromNick + '\'' +
                ", fromRemark='" + fromRemark + '\'' +
                ", to='" + to + '\'' +
                ", toAvatar='" + toAvatar + '\'' +
                ", toName='" + toName + '\'' +
                ", toNick='" + toNick + '\'' +
                ", toRemark='" + toRemark + '\'' +
                ", isRead=" + isRead +
                ", isVoiceRead=" + isVoiceRead +
                ", voiceLocalPath='" + voiceLocalPath + '\'' +
                ", isOwnSend=" + isOwnSend +
                ", isFailed=" + isFailed +
                ", isSending=" + isSending +
                ", extra1='" + extra1 + '\'' +
                ", extra2='" + extra2 + '\'' +
                ", extra3='" + extra3 + '\'' +
                '}';
    }


    public Long getId() {
        return this.id;
    }


    public void setId(Long id) {
        this.id = id;
    }


    public Long getConversationId() {
        return this.conversationId;
    }


    public void setConversationId(Long conversationId) {
        this.conversationId = conversationId;
    }


    public Long getUserId() {
        return this.userId;
    }


    public void setUserId(Long userId) {
        this.userId = userId;
    }


    public int getChatType() {
        return this.chatType;
    }


    public void setChatType(int chatType) {
        this.chatType = chatType;
    }


    public int getCmd() {
        return this.cmd;
    }


    public void setCmd(int cmd) {
        this.cmd = cmd;
    }


    public String getContent() {
        return this.content;
    }


    public void setContent(String content) {
        this.content = content;
    }


    public Long getCreateTime() {
        return this.createTime;
    }


    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }


    public String getGroup_id() {
        return this.group_id;
    }


    public void setGroup_id(String group_id) {
        this.group_id = group_id;
    }


    public String getMessageId() {
        return this.messageId;
    }


    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }


    public int getMsgType() {
        return this.msgType;
    }


    public void setMsgType(int msgType) {
        this.msgType = msgType;
    }


    public String getFrom() {
        return this.from;
    }


    public void setFrom(String from) {
        this.from = from;
    }


    public String getFromAvatar() {
        return this.fromAvatar;
    }


    public void setFromAvatar(String fromAvatar) {
        this.fromAvatar = fromAvatar;
    }


    public String getFromName() {
        return this.fromName;
    }


    public void setFromName(String fromName) {
        this.fromName = fromName;
    }


    public String getFromNick() {
        return this.fromNick;
    }


    public void setFromNick(String fromNick) {
        this.fromNick = fromNick;
    }


    public String getFromRemark() {
        return this.fromRemark;
    }


    public void setFromRemark(String fromRemark) {
        this.fromRemark = fromRemark;
    }


    public String getTo() {
        return this.to;
    }


    public void setTo(String to) {
        this.to = to;
    }


    public String getToAvatar() {
        return this.toAvatar;
    }


    public void setToAvatar(String toAvatar) {
        this.toAvatar = toAvatar;
    }


    public String getToName() {
        return this.toName;
    }


    public void setToName(String toName) {
        this.toName = toName;
    }


    public String getToNick() {
        return this.toNick;
    }


    public void setToNick(String toNick) {
        this.toNick = toNick;
    }


    public String getToRemark() {
        return this.toRemark;
    }


    public void setToRemark(String toRemark) {
        this.toRemark = toRemark;
    }


    public int getIsRead() {
        return this.isRead;
    }


    public void setIsRead(int isRead) {
        this.isRead = isRead;
    }


    public int getIsVoiceRead() {
        return this.isVoiceRead;
    }


    public void setIsVoiceRead(int isVoiceRead) {
        this.isVoiceRead = isVoiceRead;
    }


    public String getVoiceLocalPath() {
        return this.voiceLocalPath;
    }


    public void setVoiceLocalPath(String voiceLocalPath) {
        this.voiceLocalPath = voiceLocalPath;
    }


    public int getIsOwnSend() {
        return this.isOwnSend;
    }


    public void setIsOwnSend(int isOwnSend) {
        this.isOwnSend = isOwnSend;
    }


    public int getIsFailed() {
        return this.isFailed;
    }


    public void setIsFailed(int isFailed) {
        this.isFailed = isFailed;
    }


    public int getIsSending() {
        return this.isSending;
    }


    public void setIsSending(int isSending) {
        this.isSending = isSending;
    }


    public String getExtra1() {
        return this.extra1;
    }


    public void setExtra1(String extra1) {
        this.extra1 = extra1;
    }


    public String getExtra2() {
        return this.extra2;
    }


    public void setExtra2(String extra2) {
        this.extra2 = extra2;
    }


    public String getExtra3() {
        return this.extra3;
    }


    public void setExtra3(String extra3) {
        this.extra3 = extra3;
    }
}
